﻿@model XRM.Security.WebUI.Models.Request.RequestCancelModel
@{
    ViewBag.Title = "Отмена заявки";
    Layout = "~/Views/Shared/_LayoutDialog.cshtml";
}

@using (Html.BeginForm("CancelDialog", "Request", FormMethod.Post, new { id = "dlgCancelDialogForm" }))
    { 
        <div class="modal-body form-inline">
            @Html.AntiForgeryToken()
            @Html.HiddenFor(m => m.RequestId)
        
            <div class="form-group">
                <label class="control-label required">Дата отмены</label>
                @Html.EditorFor(m => m.CancelDate)
                <div>
                    @Html.ValidationMessageFor(m => m.CancelDate)
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button type="submit" class="btn btn-primary">Сохранить</button>
            <button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button>
        </div>
    }

<script type="text/javascript">
    $(function () {
        initDatepicker();
        $("#CancelDate").datepicker('option', 'maxDate', new Date());
    });
</script>